<template>
	<view>
		<u-navbar :title="title" :bgColor="bgColor" :leftIconColor="color" :placeholder="placeholder"
			:autoBack="autoBack" @leftClick="leftClick">
			<view slot="center" :style="{color: color}">{{title}}</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		name: "dwu-navbar",
		props: {
			placeholder: {
				type: Boolean,
				default: true
			},
			autoBack: {
				type: Boolean,
				default: true
			},
			title: {
				type: String,
				default: ''
			},
			bgColor: {
				type: String,
				default: '#F7F9F9'
			},
			color: {
				type: String,
				default: '#303133'
			}
		},
		data() {
			return {

			};
		},
		methods: {
			leftClick() {
				console.log();
				if (getCurrentPages().length == 1) {
					uni.reLaunch({
						url: '/pages/index/index'
					})
				}
			}
		}
	}
</script>

<style lang="less">

</style>